<template>
  <!--顾问介绍-->
  <div>
    <carousel :autoplaySpeed="autoplaySpeed" :Img="Img"></carousel>
    <v_menu :title="data.title" :site="data.list[activeIndex].list"></v_menu>

    <Row :gutter="16" class="wrapper">
      <i-col span="19" class="content">
        <i-col span="12" v-for="office in counselor">
          <router-link :to="'advisoryDetails?id='+office.id">
            <Row :gutter="16" class="figure">
              <i-col span="8">
                <div class="industry">
                  <img :src='office.phoneUri' alt="">
                  <h3>{{office.name}}</h3>
                </div>
              </i-col>
              <i-col span="16">
                <div class="counselor">
                  <p class="office" v-if="index < 6" v-for="(office,index) in office.adviserResume">
                    {{office.position}}</p>
                </div>
              </i-col>
            </Row>
          </router-link>
        </i-col>
      </i-col>
      <i-col span="5" class="navigation">
        <ngn :data="data" :activeIndex="activeIndex"></ngn>
      </i-col>
    </Row>

    <!--Vue组件-->
    <div class="page">
      <paging :all="all" @returnValue="returnValue"></paging>
    </div>
  </div>
</template>

<script>
  import carousel from '../module/carousel'
  import ngn from '../module/ngn'
  import paging from '../module/paging'
  import v_menu from '../module/menu'

  export default {
    components: {carousel, ngn, paging, v_menu},
    data() {
      return {
        all: 1,
        cur: 1,
        activeIndex: 1,
        autoplaySpeed: 100000,
        consultantsLink: this.$api.url + '/adviser/list/all/',
        Img: [
          {
            id: 1,
            imageLocation: require('../../assets/img/u69.jpg'),
            state: true,
            uri: "",
          },
        ],
        data: {
          title: '关于机构',
          list: [
            {list: '机构介绍', link: 'organizationIntroduce'},
            {list: '专家顾问', link: '/consultants'},
            {list: '组织结构', link: '/organizationStructure'},
            {list: '联系方式', link: '/contactWay'},
            {list: '期刊加盟', link: '/journalsJoin'},
          ]
        },
        counselor: [],
      }
    },
    mounted() {
      this.dataArray();
    },
    methods: {
      returnValue(data) {
        this.cur = data;
        this.dataArray()
      },
      dataArray() {
        this.$axios.get(this.consultantsLink + this.cur).then((res) => {
          this.all = res.data.totalPage;
          this.counselor = res.data.lists;
        });
      },
    }
  }
</script>

<style scoped>
  /*主要内容*/
  .wrapper .content {
    border-right: 1px solid #ccc;
    min-height: 300px;
  }

  .wrapper .navigation {
    padding-left: 0 !important;
  }

  .wrapper .content .figure {
    border: 1px solid #ccc;
    margin: 10px !important;
    border-radius: 5px;
    padding: 10px;
    height: 165px;
    color: #000;
  }

  .wrapper .content .industry {
    text-align: center;
  }

  .wrapper .content .industry img {
    width: 120px;
    height: 120px;
    border-radius: 100px;
    border: 1px solid #ccc;
  }

  .wrapper .content .counselor .office {
    font-size: 14px;
    font-weight: bold;
  }
</style>
